rm -rf  ~/.local/share/.tapdata
ps -ef|grep /root/daas/jar | grep tm-0.0.1 |grep -v grep|awk  '{print "kill -9 " $2}' |sh
sleep 2
ps -ef|grep /root/daas/jar | grep connector-manager |grep -v grep|awk  '{print "kill -9 " $2}' |sh
sleep 2
ps -ef|grep /root/daas/jar | grep jacoco |grep -v grep|awk  '{print "kill -9 " $2}' |sh
sleep 2
ps -ef|grep /root/daas/tapdata-web  |grep -v grep|awk  '{print "kill -9 " $2}' |sh
sleep 2
ps -ef|grep /root/daas/jar |grep -v grep|awk  '{print "kill -9 " $2}' |sh
#ps -ef|grep /root/daas |grep -v grep|awk  '{print "kill -9 " $2}' |sh
sleep 2

for i in `lsof -i:3001 | awk '{print $2}' | grep -v 'PID'`;do kill -9 $i;done
sleep 2

for i in `lsof -i:8082 | awk '{print $2}' | grep -v 'PID'`;do kill -9 $i;done
sleep 2
for i in `lsof -i:9101 | awk '{print $2}' | grep -v 'PID'`;do kill -9 $i;done
sleep 2
for i in `lsof -i:9102 | awk '{print $2}' | grep -v 'PID'`;do kill -9 $i;done
sleep 2



cd /root/daas/daas/backend
npm i
node run_init.js 'DAAS' 'all' 'false' 'mongodb://root:tapdata@192.168.0.30:32000/pdklocal?authSource=admin'

rm -rf /root/daas/jar/connector-manager.jar
rm -rf /root/daas/jar/tm-0.0.1.jar

cp /root/daas/daas/connector/connector-manager.jar  /root/daas/jar
cp /root/daas/daas-cloud/tm/tm/target/tm-0.0.1.jar /root/daas/jar

cd /root/daas/jar
#nohup java -jar -Dserver.port=3001 -Dspring.data.mongodb.uri=mongodb://root:tapdata@192.168.0.30:32000/manager?authSource=admin -server -Xms1g -Xmx1g tm-*.jar > tm.log  2&>1 &
nohup java -javaagent:jacocoagent.jar=includes=*,output=tcpserver,port=9102,address=127.0.0.1  -jar -Dserver.port=3001 -Dspring.data.mongodb.uri=mongodb://root:tapdata@192.168.0.30:32000/pdklocal?authSource=admin -server -Xms1g -Xmx1g /root/daas/jar/tm-*.jar > /root/daas/jar/tm.log  2&>1 &


#java -javaagent:jacocoagent.jar=includes=*,output=tcpserver,port=9101,address=127.0.0.1 -jar -Dserver.port=3001 -Dspring.data.mongodb.uri=mongodb://root:tapdata@192.168.0.30:32000/manager?authSource=admin -server -Xms1g -Xmx1g /root/daas/daas-cloud/tm/tm/target/tm-*.jar

export app_type=DAAS; export backend_url=http://127.0.0.1:3001/api/; export TAPDATA_MONGO_URI=mongodb://root:tapdata@192.168.0.30:32000/pdklocal?authSource=admin;
#java -jar connector-manager.jar
nohup java -javaagent:jacocoagent.jar=includes=*,output=tcpserver,port=9101,address=127.0.0.1 -jar /root/daas/jar/connector-manager.jar &
#nohup java  -jar connector-manager.jar > fe.log  2&>1 &

#npm install -g pnpm
cd /root/daas/tapdata-web
nohup pnpm i &
sleep 10
cd /root/daas/tapdata-web/apps/daas
nohup pnpm start:dev -- --port=8082 &

nohup bash /root/daas/idaas-pdk/buildpdk.sh &
